package com.example.trackcircuitdiagnosis.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

 import jakarta.persistence.Id;

import java.sql.Date;

@Data
@TableName(value = "sys_user")
@Schema(name = "sys_user", description = "用户表")
public class UserEntity {
    @Id
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "用户ID")
    private Integer id;

    @Schema(description = "用户名")
    private String username;

    @Schema(description = "密码")
    private String password;

    @Schema(description = "电子邮件")
    private String email;

    @Schema(description = "电话号码")
    private String phone;

    @Schema(description = "昵称")
    private String nickname;

    @Schema(description = "地址")
    private String address;

    @TableField(value = "created_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Schema(description = "创建时间")
    private Date createdTime;

    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "角色")
    private String role;

    @Schema(description = "令牌")
    private String token;
}
